Skip to content

Conversation

@KirylSAP
Copy link
Contributor

@KirylSAP KirylSAP commented Feb 9, 2026

Summary

Type leakage in the ui-components package caused by public component interfaces extending types from third-party libraries. These leaked types introduce unintended compile-time dependencies for consumers and break the abstraction boundary of the package.

Changes Made

• Refactored PopupMenu public interfaces:
(PopupMenuProps, PopupMenuToggleProps, PopupMenuItemProps, PopupMenuOptionsProps) to use only our own/React types instead of types from @headlessui/react, while keeping Headless UI as an internal implementation detail.
• Introduced dedicated DateTimePicker type module (types.ts) with DateOption, DateLimit, LocaleKey, CustomLocale, and DateChangeHandler (plus backward-compatible Juno* aliases), and wired DateTimePickerProps to use these types instead of flatpickr types.
• Added internal mappers.ts for DateTimePicker to convert our public types into flatpickr types, ensuring that flatpickr remains fully encapsulated and its types are not exposed from the package.
• Updated Tab, TabList, and TabPanel components to define their own TabProps, TabListProps, and TabPanelProps instead of extending react-tabs types, keeping react-tabs usage internal.
• Adjusted packages/ui-components/src/index.ts exports so consumers import only our public DateTimePicker and PopupMenu/Tab types, with no direct dependency on third-party type definitions.

Related Issues

Testing Instructions

  1. pnpm i
  2. pnpm lint
  3. pnpm test

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have created a changeset for my changes.

PR Manifesto

Review the PR Manifesto for best practises.

@KirylSAP KirylSAP requested review from a team and franzheidl as code owners February 9, 2026 14:42
@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

🦋 Changeset detected

Latest commit: d7b16a9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Patch
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1445/

Built to branch gh-pages at 2026-02-11 13:47 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@KirylSAP KirylSAP changed the title feat: decouple interfaces from external interfaces feat(ui-components): decouple interfaces from external interfaces Feb 9, 2026
@KirylSAP KirylSAP changed the title feat(ui-components): decouple interfaces from external interfaces feat(ui): decouple interfaces from external interfaces Feb 9, 2026
TilmanHaupt
TilmanHaupt previously approved these changes Feb 9, 2026
Copy link
Contributor

@TilmanHaupt TilmanHaupt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link
Contributor

@taymoor89 taymoor89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care. Good work.
I'd suggest to change public interfaces of the components as less as possible and for standard html attributes extend with React.HTMLElement<HTMLElement> so we don't have to individually specify them.

taymoor89
taymoor89 previously approved these changes Feb 10, 2026
Copy link
Contributor

@taymoor89 taymoor89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! 👍

Copy link
Contributor

@taymoor89 taymoor89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest releasing these types fixes as patch version update.

franzheidl
franzheidl previously approved these changes Feb 11, 2026
Copy link
Contributor

@franzheidl franzheidl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thank you Kiryl!

Co-authored-by: Kiryl Mishchuk <{[email protected]}>
@taymoor89 taymoor89 dismissed stale reviews from franzheidl and themself via b9efafa February 11, 2026 13:42
@franzheidl franzheidl self-requested a review February 11, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants